package springboot.base.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:
 *
 * 1. 只要保证当前类在主启动类所在的根包路径下，就会自动扫描到IOC容器
 * 2. @RestController = @ResponseBody + @Controller
 * 3. @RequestMapping("")
 * 4. @Value("${}") 读取配置文件 application.properties 配置参数值
 */

@RestController
@RequestMapping("hello")
public class HelloController {

    @Value("${author.name}")
    private String name;

    @GetMapping("boot")
    public String hello(){
        System.out.println(name);
        return "hello springboot3!!";
    }
}
